-- phpMyAdmin SQL Dump
-- version 3.3.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 27, 2011 at 04:32 AM
-- Server version: 5.0.67
-- PHP Version: 5.2.14

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `cake`
--
drop database if exists cake;

create database cake;

use cake;
-- --------------------------------------------------------

--
-- Table structure for table `cake`
--

CREATE TABLE IF NOT EXISTS `cake` (
  `id` bigint(20) NOT NULL auto_increment,
  `name` varchar(30) default NULL,
  `price` decimal(10,2) default NULL,
  `remark` varchar(2000) default NULL,
  `picture` varchar(200) default NULL,
  `category` bigint(20) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK_Reference_1` (`category`)
) ENGINE=InnoDB  DEFAULT CHARSET=gbk AUTO_INCREMENT=17 ;

--
-- Dumping data for table `cake`
--

INSERT INTO `cake` (`id`, `name`, `price`, `remark`, `picture`, `category`) VALUES
(1, 'musi', 148.00, 'taste good', 'images/cake/musi.jpg', 1),
(2, 'qiaokeli', 99.00, 'taste good', 'images/cake/qiaokeli.jpg', 1),
(3, 'hunli', 200.00, 'taste good', 'images/cake/hunli.jpg', 1),
(4, 'ertong', 120.00, 'taste good', 'images/cake/ertong.jpg', 1),
(5, 'tianbao', 148.00, 'taste good', 'images/bread/tianbao.jpg', 2),
(6, 'jiaxian', 99.00, 'taste good', 'images/bread/jiaxian.jpg', 2),
(7, 'danmai', 200.00, 'taste good', 'images/bread/danmai.jpg', 2),
(8, 'fabang', 120.00, 'taste good', 'images/bread/fabang.jpg', 2),
(9, 'changwen', 148.00, 'taste good', 'images/xidian/changwen.jpg', 3),
(10, 'pai', 99.00, 'taste good', 'images/xidian/pai.jpg', 3),
(11, 'jianguo', 200.00, 'taste good', 'images/bingan/jianguo.jpg', 4),
(12, 'hunshu', 120.00, 'taste good', 'images/bingan/hunshu.jpg', 4),
(13, 'new product1', 200.00, 'new...', 'images/new/new1.jpg', 5),
(14, 'new product2', 340.00, 'new...', 'images/new/new2.jpg', 5),
(15, 'new product3', 500.00, 'new...', 'images/new/new3.jpg', 5),
(16, 'new product4', 320.00, 'new...', 'images/new/new4.jpg', 5);

-- --------------------------------------------------------

--
-- Table structure for table `category`
--

CREATE TABLE IF NOT EXISTS `category` (
  `id` bigint(20) NOT NULL auto_increment,
  `name` varchar(30) default NULL,
  `remark` varchar(2000) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=gbk AUTO_INCREMENT=6 ;

--
-- Dumping data for table `category`
--

INSERT INTO `category` (`id`, `name`, `remark`) VALUES
(1, 'cake', NULL),
(2, 'bread', NULL),
(3, 'cookies', NULL),
(4, 'sweet', NULL),
(5, 'new products', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `diy`
--

CREATE TABLE IF NOT EXISTS `diy` (
  `id` bigint(20) NOT NULL auto_increment,
  `userid` bigint(20) default NULL,
  `phone` varchar(11) default NULL,
  `amount` decimal(10,2) default NULL,
  `code` varchar(22) default NULL,
  `status` int(11) default NULL,
  `address` varchar(200) default NULL,
  `quantity` int(11) default NULL,
  `remark` varchar(500) default NULL,
  `description` varchar(1000) default NULL,
  `picture` varchar(100) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=gbk AUTO_INCREMENT=5 ;

--
-- Dumping data for table `diy`
--


-- --------------------------------------------------------

--
-- Table structure for table `manager`
--

CREATE TABLE IF NOT EXISTS `manager` (
  `id` bigint(20) NOT NULL auto_increment,
  `username` varchar(30) default NULL,
  `password` varchar(20) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=gbk AUTO_INCREMENT=2 ;

--
-- Dumping data for table `manager`
--

INSERT INTO `manager` (`id`, `username`, `password`) VALUES
(1, 'admin', '123456');

-- --------------------------------------------------------

--
-- Table structure for table `myorder`
--

CREATE TABLE IF NOT EXISTS `myorder` (
  `id` bigint(20) NOT NULL auto_increment,
  `code` varchar(22) default NULL,
  `amount` decimal(10,2) default NULL,
  `status` int(11) default NULL,
  `userid` bigint(20) default NULL,
  `address` varchar(200) default NULL,
  `phone` varchar(11) default NULL,
  `remark` varchar(500) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK_Reference_2` (`userid`)
) ENGINE=InnoDB  DEFAULT CHARSET=gbk AUTO_INCREMENT=16 ;

--
-- Dumping data for table `myorder`
--

INSERT INTO `myorder` (`id`, `code`, `amount`, `status`, `userid`, `address`, `phone`, `remark`) VALUES
(6, '20111205015537588', 1480.00, 3, 1, 'chongqing', '13996373835', 'please quick'),
(7, '20111205030724838', 99.00, 2, 1, 'hhh', '13996383547', '4567'),
(8, '20111205030756463', 400.00, 3, 1, 'guangdong', '13996373589', 'fast22'),
(9, '2011120503082425', 600.00, 3, 1, 'jiangxi', '13969874578', 'dsaggd'),
(10, '20111206094456687', 360.00, 2, 1, 'fujian', '13569787415', ''),
(11, '2011120609510062', 297.00, 1, 2, 'beijing', '13996383578', ''),
(12, '20111206095204281', 360.00, 2, 3, 'zhejiang', '15925897894', ''),
(15, '2011121602441515', 600.00, 1, 1, 'jiangshu', '15968487895', '');

-- --------------------------------------------------------

--
-- Table structure for table `orderdetail`
--

CREATE TABLE IF NOT EXISTS `orderdetail` (
  `id` bigint(20) NOT NULL auto_increment,
  `orderid` bigint(20) default NULL,
  `cakeid` bigint(20) default NULL,
  `quantity` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=gbk AUTO_INCREMENT=10 ;

--
-- Dumping data for table `orderdetail`
--

INSERT INTO `orderdetail` (`id`, `orderid`, `cakeid`, `quantity`) VALUES
(1, 6, 1, 10),
(2, 7, 2, 1),
(3, 8, 3, 2),
(4, 9, 3, 3),
(5, 10, 8, 3),
(6, 11, 10, 3),
(7, 12, 12, 3),
(9, 15, 3, 3);

-- --------------------------------------------------------

--
-- Table structure for table `shoppingcart`
--

CREATE TABLE IF NOT EXISTS `shoppingcart` (
  `id` bigint(20) NOT NULL auto_increment,
  `cakeid` bigint(20) default NULL,
  `quantity` int(11) default NULL,
  `userid` bigint(20) default NULL,
  `remark` varchar(500) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=gbk AUTO_INCREMENT=13 ;

--
-- Dumping data for table `shoppingcart`
--

INSERT INTO `shoppingcart` (`id`, `cakeid`, `quantity`, `userid`, `remark`) VALUES
(11, 2, 3, 3, 'null'),
(12, 13, 4, 1, 'null');

-- --------------------------------------------------------

--
-- Table structure for table `user`
--

CREATE TABLE IF NOT EXISTS `user` (
  `id` bigint(20) NOT NULL auto_increment,
  `username` varchar(30) default NULL,
  `password` varchar(20) default NULL,
  `idcard` varchar(18) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=gbk AUTO_INCREMENT=4 ;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`id`, `username`, `password`, `idcard`) VALUES
(1, 'customer', '123456', '360835198805242115'),
(2, 'cyxl', '123456', '360835198805262546'),
(3, 'user', '123456', '360879198705021598');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `cake`
--
ALTER TABLE `cake`
  ADD CONSTRAINT `FK_Reference_1` FOREIGN KEY (`category`) REFERENCES `category` (`id`);

--
-- Constraints for table `myorder`
--
ALTER TABLE `myorder`
  ADD CONSTRAINT `FK_Reference_2` FOREIGN KEY (`userid`) REFERENCES `user` (`id`);
